package com.study_security.service;

import com.study_security.entity.Project;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface AuditService {
    List<Project> findPendingByName(String name);
    List<Project> findApprovedByName(String name);

    List<Project> findOngoingByName(String name);
   // void delete(int id);
   List<Project> findPending();
    List<Project> findApproved();

    List<Project> findOngoing();


    @Transactional
     boolean updateProjectStatus(Long projectId, boolean isApproved);
}
//<button onclick="updateStatus(1, true)">通过</button>
//<button onclick="updateStatus(1, false)">不通过</button>
//
//<script>
//function updateStatus(projectId, isApproved) {
//        fetch(`/api/audit/updateStatus?projectId=${projectId}&isApproved=${isApproved}`, {
//        method: 'POST',
//        headers: {
//        'Content-Type': 'application/x-www-form-urlencoded',
//        }
//        })
//        .then(response => response.text())
//        .then(data => alert(data))
//        .catch(error => console.error('Error:', error));
//        }
//</script>
